<?php session_start();
 include 'conexaoMysql.php';
$crud = new crud();

			if(isset ($_REQUEST['logar'])){
			$email= $_REQUEST['email'];
			$senha= $_REQUEST['senha'];
			 $sql = ("SELECT * FROM tbUsuarios WHERE tbUsuariosEmail='$email' AND tbUsuariosSenha= '$senha'");
			$query=mysql_query($sql)  or die (mysql_error()); 
			$qtda = mysql_num_rows ($query);
			if($qtda==0){
			echo"<script>alert('Email ou Senha Incorretos');Location.href='logar.php'</script>"; 
			}else{
				$_SESSION['email']= $email;
				$_SESSION['senha']= $senha;
				$_SESSION['idEvento']= '';
                                $_SESSION['idCurso']='';
					header("Location:index.php");

			}
			}
			?>
<html>
<head><title>FAZER LOGO</title>
<link href="styles/styles.css" rel="stylesheet" type="text/css">
</head>
<body>
	<div id="topologar">
	
	</div>
	<div id="logar">
	
				<b><h3><center>SEJA BEM-VINDO AO PAINEL ADM</h3>
	
						<HR WIDTH=100%>
					<form action="logar.php" name="cadastro" method="post"  >
					<label>Email:<br>
					<input name="email" type="text" tabindex="1" size="15" required><br>
					</label>
						<label>Senha:<br>
						<input name="senha" type="password" tabindex="2" size="15">
							<input type="submit" name="logar" value="OK" ><br>
							</form>
								
								<a href="recuperasenha.php">Esqueci a Senha</a><br></b></center>
									<HR WIDTH=100%>	
								</div>
</body>
</html>